/**   
* @Title: PrepareResult.java
* @Package me.paxos.bean
* @Description: TODO
* @author xaoyaoyao
* @date Dec 25, 2018 11:51:15 AM
* @version V1.0   
*/
package me.paxos.bean;

/**
 * @ClassName: PrepareResult
 * @Description: 决策者针对提议者的准备提案的回复
 * @author xaoyaoyao
 * @date Dec 25, 2018 11:51:15 AM
 * 
 */
public class PrepareResult {

	// 是否承诺
	private boolean isPromised;
	// 决策者的状态
	private AcceptorStatus acceptorStatus = AcceptorStatus.NONE;
	// 决策者返回的提案。
	private Proposal proposal;

	/**
	 * @return isPromised
	 */
	public boolean isPromised() {
		return isPromised;
	}

	/**
	 * @param isPromised
	 *            the isPromised to set
	 */
	public void setPromised(boolean isPromised) {
		this.isPromised = isPromised;
	}

	/**
	 * @return acceptorStatus
	 */
	public AcceptorStatus getAcceptorStatus() {
		return acceptorStatus;
	}

	/**
	 * @param acceptorStatus
	 *            the acceptorStatus to set
	 */
	public void setAcceptorStatus(AcceptorStatus acceptorStatus) {
		this.acceptorStatus = acceptorStatus;
	}

	/**
	 * @return proposal
	 */
	public Proposal getProposal() {
		return proposal;
	}

	/**
	 * @param proposal
	 *            the proposal to set
	 */
	public void setProposal(Proposal proposal) {
		this.proposal = proposal;
	}

	@Override
	public String toString() {
		return "PrepareResult [isPromised=" + isPromised + ", acceptorStatus=" + acceptorStatus + ", proposal=" + proposal + "]";
	}

}
